#!/bin/bash
#DT=`date -d '-1 day' +%Y-%m-%d`

/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from customer where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table customer \
--split-by id \
-m 2


wait

/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from customer_appeal where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table customer_appeal \
--split-by id \
-m 2

wait

/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from customer_clue where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table customer_clue \
--split-by id \
-m 2

wait

/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from customer_relationship where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table customer_relationship \
--split-by id \
-m 2




/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from customer_relationship where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table customer_relationship \
--split-by id \
-m 2




wait


/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from employee where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table employee \
--split-by id \
-m 2

wait

/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from itcast_clazz where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table itcast_clazz \
--split-by id \
-m 2


wait

/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from itcast_school where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table itcast_school \
--split-by id \
-m 2





wait

/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from itcast_subject where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table itcast_subject \
--split-by id \
-m 2

wait

/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/scrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,substr(create_date_time,1,4) as dt \
 from scrm_department where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table scrm_department \
--split-by id \
-m 2

